package com.denso.workflow.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

/**
 * Created by lijian on 2017/12/7.
 */
public class OperatorInterceptor implements Interceptor {
    @Override
    public void intercept(Invocation inv) {
        String operator = inv.getController().getSessionAttr("operator");
        if(operator == null) {
            inv.getController().render("/login.html");
        } else {
            inv.invoke();
        }
    }
}
